package com.ruoyi.pv.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pv.mapper.PvOrganizationMapper;
import com.ruoyi.pv.domain.PvOrganization;
import com.ruoyi.pv.service.IPvOrganizationService;

/**
 * 组织机构Service业务层处理
 *
 * @author zzx
 * @date 2023-03-12
 */
@Service
public class PvOrganizationServiceImpl implements IPvOrganizationService {
    @Autowired
    private PvOrganizationMapper pvOrganizationMapper;

    /**
     * 查询组织机构
     *
     * @param id 组织机构主键
     * @return 组织机构
     */
    @Override
    public PvOrganization selectPvOrganizationById(Long id) {
        return pvOrganizationMapper.selectPvOrganizationById(id);
    }

    /**
     * 查询组织机构列表
     *
     * @param pvOrganization 组织机构
     * @return 组织机构
     */
    @Override
    public List<PvOrganization> selectPvOrganizationList(PvOrganization pvOrganization) {
        return pvOrganizationMapper.selectPvOrganizationList(pvOrganization);
    }

    /**
     * 新增组织机构
     *
     * @param pvOrganization 组织机构
     * @return 结果
     */
    @Override
    public int insertPvOrganization(PvOrganization pvOrganization) {
        pvOrganization.setCreateTime(DateUtils.getNowDate());
        return pvOrganizationMapper.insertPvOrganization(pvOrganization);
    }

    /**
     * 修改组织机构
     *
     * @param pvOrganization 组织机构
     * @return 结果
     */
    @Override
    public int updatePvOrganization(PvOrganization pvOrganization) {
        return pvOrganizationMapper.updatePvOrganization(pvOrganization);
    }

    /**
     * 批量删除组织机构
     *
     * @param ids 需要删除的组织机构主键
     * @return 结果
     */
    @Override
    public int deletePvOrganizationByIds(Long[] ids) {
        return pvOrganizationMapper.deletePvOrganizationByIds(ids);
    }

    /**
     * 删除组织机构信息
     *
     * @param id 组织机构主键
     * @return 结果
     */
    @Override
    public int deletePvOrganizationById(Long id) {
        return pvOrganizationMapper.deletePvOrganizationById(id);
    }
}
